package com.example.hdx.entity;


import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;


// Cart.java
@Data
@TableName("cart")
public class Cart {
    @TableId(type = IdType.AUTO)
    private Long id;
    private Long userId;
    private Long productId;
    private Integer quantity;
    private Boolean selected;

    @TableField(fill = FieldFill.INSERT)
    private Date createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatedAt;

    // 关联商品信息（非数据库字段）
    @TableField(exist = false)
    private Product product;
}